* lisp/progmodes/xref.el (xref-revert-buffer):
When 'revert-buffer-restore-functions' is bound,
use it in the same way as in 'revert-buffer'.
"Refresh the search results in the current buffer."
(interactive)
(let ((inhibit-read-only t)
- (buffer-undo-list t))
+ (buffer-undo-list t)
+ restore-functions)
+ (when (boundp 'revert-buffer-restore-functions)
+ (run-hook-wrapped 'revert-buffer-restore-functions
+ (lambda (f) (push (funcall f) restore-functions) nil)))
(save-excursion
(condition-case err
(let ((alist (xref--analyze (funcall xref--fetcher)))
(inhibit-modification-hooks t))
(erase-buffer)
- (xref--insert-xrefs alist))
+ (prog1 (xref--insert-xrefs alist)
+ (mapc #'funcall (delq nil restore-functions))))
(user-error
(erase-buffer)
(insert